package org.linlinjava.litemall.admin.web2.auth.resp;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.linlinjava.litemall.admin.web2.auth.Auth;
import org.linlinjava.litemall.core.util.Util;
import org.linlinjava.litemall.db.domain.TAdminRole;
import org.linlinjava.litemall.db.util.Str;

@ApiModel
public class AResp3 {

    @ApiModelProperty("类型id")
    private Integer id;

    @ApiModelProperty("权限数组(传中文)")
    private String[] roleAuth;

//
//    @ApiModelProperty("修改密码")
//    private Boolean modifyPwd;
//
//    @ApiModelProperty("待付款")
//    private Boolean order1;
//    @ApiModelProperty("已支付未成团")
//    private Boolean order2;
//    @ApiModelProperty("待发货")
//    private Boolean order3;
//    @ApiModelProperty("已发货")
//    private Boolean order4;
//    @ApiModelProperty("待提货")
//    private Boolean order5;
//    @ApiModelProperty("已提货")
//    private Boolean order6;
//    @ApiModelProperty("已关闭")
//    private Boolean order7;
//    @ApiModelProperty("查看订单")
//    private Boolean order8;
//    @ApiModelProperty("导出订单")
//    private Boolean order9;
//
//
//    @ApiModelProperty("发布商品")
//    private Boolean goods1;
//    @ApiModelProperty("修改商品")
//    private Boolean goods2;
//    @ApiModelProperty("设置每日库存")
//    private Boolean goods3;
//    @ApiModelProperty("折扣价")
//    private Boolean goods4;
//    @ApiModelProperty("同步总后台授权产品")
//    private Boolean goods5;
//
//    @ApiModelProperty("设置及时达商品")
//    private Boolean settingTimeliy;
//    @ApiModelProperty("设置秒杀商品")
//    private Boolean settingSeckill;
//    @ApiModelProperty("设置拼团商品")
//    private Boolean settingGroup;
//    @ApiModelProperty("设置佣金")
//    private Boolean settingCom;


    public AResp3(TAdminRole role) {
//        roleAuth = Auth.getAuth(role);
        roleAuth = new String[]{};
        String auths = role.getAuths();
        if (!Str.isEmpty(auths))
            roleAuth = auths.split(",");
        id = role.getId();
    }

    public AResp3() {
    }

    public String[] getRoleAuth() {
        return roleAuth;
    }

    public void setRoleAuth(String[] roleAuth) {
        this.roleAuth = roleAuth;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
}
